const { classImgUrlArr } = require('./constant')
// 根据课程名字，获取课程图标
const getClassImgUrl = (name) => {
    let classImgUrl;
    let existName = false;
    classImgUrlArr.forEach((item) => {
        if (item.name === name) {
            classImgUrl= item.classImgUrl;
            existName = true;
        }
    })
    if(!existName){
        classImgUrl= 'https://s2.loli.net/2022/02/13/q617nAWNDy95FZ3.png';
    }
    return classImgUrl;
}

module.exports = {
    getClassImgUrl,
}